package com.kingsalert.kingsalert.analytics.data_sdk.services;

import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;

import androidx.core.content.ContextCompat;

import com.kingsalert.kingsalert.analytics.data_sdk.beans.ASDecBn;
import com.kingsalert.kingsalert.analytics.data_sdk.util.ASGeneralUtil;
import com.kingsalert.kingsalert.analytics.data_sdk.util.ASHarewareUtil;
import com.kingsalert.kingsalert.analytics.data_sdk.util.ASNetworkUtil;
import com.kingsalert.kingsalert.analytics.data_sdk.util.ASStoreUtil;

public class ASDecIfo {

    public static ASDecBn getDatas(Context paramContext) {
        ASDecBn bean = new ASDecBn();
        if (PackageManager.PERMISSION_GRANTED == ContextCompat.checkSelfPermission(paramContext, Manifest.permission.READ_PHONE_STATE)) {
            try {
                bean.setMac(ASNetworkUtil.getMacAddress(paramContext));
                bean.setImei(ASGeneralUtil.getImei(paramContext));
                bean.setLaguage(ASGeneralUtil.getLanguage(paramContext));
                bean.setArea(ASGeneralUtil.getArea(paramContext));
                bean.setScreenHeight(ASGeneralUtil.getDeviceHeight(paramContext));
                bean.setScreenWidth(ASGeneralUtil.getDeviceWidth(paramContext));
                bean.setNetworkData(ASGeneralUtil.getSimOperatorName(paramContext));
                bean.setFrontCameraPixels(ASHarewareUtil.getFrontCameraPixels(paramContext));
                bean.setRearCameraPixels(ASHarewareUtil.getBackCameraPixels(paramContext));
                bean.setRa(ASStoreUtil.getRamTotal(paramContext));
                bean.setRo(ASStoreUtil.getCashTotal(paramContext));
                bean.setIp(ASNetworkUtil.getIPAddress(paramContext));
                bean.setIp2(ASNetworkUtil.getIPAddress(paramContext));
                bean.setNetworkEnvironment(ASGeneralUtil.getNetworkType(paramContext));
                bean.setCu(ASGeneralUtil.getCpuModel(paramContext));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return bean;
    }

}
